package com.example.java_email_send.api;

import com.example.java_email_send.utils.SendEmailUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 李云龙
 * @program: java_email_send
 * @description: 邮件发送接口
 * @date 2024-09-07 21:17:19
 */
@Api(value = "邮件发送接口", tags = "邮件接口") // 指定类的名字和标签
@RestController
@RequestMapping("/mail")
public class SendEmailApi {
    @Autowired
    private JavaMailSender javaMailSender;

    @Autowired
    private SendEmailUtil sendEmailUtil;

    @ApiOperation(value = "发送简单邮件", notes = "这个方法用于发送简单的文本邮件") // 指定方法的名字和描述
    @GetMapping(value = "/sendSimpleMailMessage", name = "发送普通邮件")
    public String sendSimpleMailMessage() throws Exception {
//        sendEmailUtil.sendSimpleMailMessage();
        return "okkkkkkkkkkkk";
    }


    @ApiOperation(value = "发送复杂邮件", notes = "这个方法用于发送复杂的邮件") // 指定方法的名字和描述
    @GetMapping(value = "/sendMimeMessage", name = "发送复杂邮件")
    public String sendMimeMessage() throws Exception {
//        sendEmailUtil.sendMimeMessage();
        return "okkkkkkkkkkkk";
    }
}
